<html>
<head><meta charset="utf-8"><title>Optimization PRs · t-compiler/wg-polonius · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/index.html">t-compiler/wg-polonius</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html">Optimization PRs</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="221160364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221160364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221160364">(Dec 29 2020 at 19:34)</a>:</h4>
<p>I haven't been around much lately, but I had some down time around the holidays and spent some of it reading large portions of both chalk and polonius. Polonius was a bit more approachable for me, and seems to have fewer contributors even during the sprints. I know the project currently in a fallow period, but I'm wondering if there's any point in filing PRs to optimize datafrog/polonius. Perhaps to be reviewed during the next sprint?</p>
<p>My impression from my quick review is that the rulesets will change quite a bit before they are production ready (perhaps this is more true for the initialization/liveness analysis, which seems pretty slow, than for the borrow checker). With that in mind, It would be better to focus on code that is totally encapsulated and are very likely to be hot even if the ruleset changes significantly. <code>Relation::merge</code> is a good example, and I have a few other spots in mind.</p>
<p>That said, I don't think it's the best use of WG-polonius time to be reviewing unsafe code and reproducing micro-benchmarks. Perhaps there's other issues I could work on asynchronously? For example, I think I could remove<code>Location::All</code>, although I suspect it would be a lot harder for me than for members of this WG. Improving the datafrog documentation and experimenting with <code>O(1)</code> relations (mainly for <code>cfg_edge</code>) also came to mind.</p>



<a name="221160428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221160428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221160428">(Dec 29 2020 at 19:35)</a>:</h4>
<p>hey Dylan :)</p>



<a name="221160515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221160515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221160515">(Dec 29 2020 at 19:36)</a>:</h4>
<p>Hey Rémy</p>



<a name="221160530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221160530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221160530">(Dec 29 2020 at 19:36)</a>:</h4>
<p>the rulesets will likely change indeed, not all the upfront design work, nor integration with chalk has been worked out yet</p>



<a name="221160560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221160560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221160560">(Dec 29 2020 at 19:37)</a>:</h4>
<p>my personal hunch is I feel it's unlikely we can get datalog production ready</p>



<a name="221160568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221160568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221160568">(Dec 29 2020 at 19:37)</a>:</h4>
<p>but who knows</p>



<a name="221160643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221160643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221160643">(Dec 29 2020 at 19:38)</a>:</h4>
<p>your experience with rustc's dataflow could say that looking at move/init it's unlikely as well</p>



<a name="221160649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221160649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221160649">(Dec 29 2020 at 19:38)</a>:</h4>
<p>Got it. I meant to ask, was there an initial prototype that just used Souffle?</p>



<a name="221160679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221160679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221160679">(Dec 29 2020 at 19:38)</a>:</h4>
<p>probably not a prototype per se</p>



<a name="221160683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221160683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221160683">(Dec 29 2020 at 19:38)</a>:</h4>
<p>however</p>



<a name="221160696"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221160696" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221160696">(Dec 29 2020 at 19:38)</a>:</h4>
<p>the rules themselves were definitely tried there</p>



<a name="221160713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221160713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221160713">(Dec 29 2020 at 19:39)</a>:</h4>
<p>and there was a timely/differential dataflow prototype</p>



<a name="221160742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221160742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221160742">(Dec 29 2020 at 19:39)</a>:</h4>
<p>you couldn't use the soufflé rules inside rustc, only their tools were used IIRC</p>



<a name="221160796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221160796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221160796">(Dec 29 2020 at 19:40)</a>:</h4>
<p>at least I never did rust + soufflé integration</p>



<a name="221160857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221160857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221160857">(Dec 29 2020 at 19:41)</a>:</h4>
<p>I seem to recall (that was a couple years ago) there were some caveats where some of the things allowed in DD/datafrog were not acceptable datalog, but there probably was a workaround</p>



<a name="221160858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221160858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221160858">(Dec 29 2020 at 19:41)</a>:</h4>
<p>I was a bit surprised that development seemed to jump right to differential dataflow and then to datafrog.</p>



<a name="221160865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221160865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221160865">(Dec 29 2020 at 19:41)</a>:</h4>
<p>I was wondering if I had missed a step in the process</p>



<a name="221160915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221160915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221160915">(Dec 29 2020 at 19:42)</a>:</h4>
<p>IIRC there were some other repos from Niko</p>



<a name="221160930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221160930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221160930">(Dec 29 2020 at 19:42)</a>:</h4>
<p>but since that was part of NLL back then rather than polonius per se</p>



<a name="221160938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221160938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221160938">(Dec 29 2020 at 19:42)</a>:</h4>
<p>it's hard for me to say</p>



<a name="221160979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221160979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221160979">(Dec 29 2020 at 19:43)</a>:</h4>
<p>I didn't see a triejoin/leapjoin equivalent in Souffle, so I thought maybe that was it. Other than that, they're both semi-naive solvers AFAICT.</p>



<a name="221160994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221160994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221160994">(Dec 29 2020 at 19:43)</a>:</h4>
<p>right</p>



<a name="221161004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221161004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221161004">(Dec 29 2020 at 19:43)</a>:</h4>
<p>they have richer data structures and parallelism</p>



<a name="221161023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221161023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221161023">(Dec 29 2020 at 19:43)</a>:</h4>
<p>Okay, but maybe it's better for me to not work on datafrog so much?</p>



<a name="221161074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221161074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221161074">(Dec 29 2020 at 19:44)</a>:</h4>
<p>as for your other questions, whether it's worth our time to review microbenchmarks: the work you did is valuable and I'm personally very thankful</p>



<a name="221161087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221161087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221161087">(Dec 29 2020 at 19:44)</a>:</h4>
<p>it's not wasted work at all</p>



<a name="221161108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221161108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221161108">(Dec 29 2020 at 19:44)</a>:</h4>
<p>whether it's the best use of your time is another interesting question</p>



<a name="221161121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221161121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221161121">(Dec 29 2020 at 19:45)</a>:</h4>
<p>there are some interesting things to do in datafrog for sure</p>



<a name="221161197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221161197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221161197">(Dec 29 2020 at 19:46)</a>:</h4>
<p>especially wrt to data representation, possibly parallelism (the semi naive evaluation is trivially parallelisable but that won't probably work super well :) probabilistic data structures</p>



<a name="221161229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221161229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221161229">(Dec 29 2020 at 19:46)</a>:</h4>
<p>(eg for the latter point some relations are only used in antijoins)</p>



<a name="221161290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221161290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221161290">(Dec 29 2020 at 19:47)</a>:</h4>
<p>for the 1st, more compact data would also help, but since datafrog is super tied to binary search and sorting and all, it's not super clear how to tackle that at first</p>



<a name="221161369"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221161369" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221161369">(Dec 29 2020 at 19:48)</a>:</h4>
<p>or ways to limit copying in dataflow-like situations, you know all this</p>



<a name="221161413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221161413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221161413">(Dec 29 2020 at 19:49)</a>:</h4>
<p>Yeah, the <code>O(1)</code> relation change is going would be pretty invasive, but I think it's worth doing if we're committed to datafrog as the solver going forward, and I think I could make it happen.</p>



<a name="221161428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221161428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221161428">(Dec 29 2020 at 19:49)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116113">lqd</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/Optimization.20PRs/near/221160560">said</a>:</p>
<blockquote>
<p>my personal hunch is I feel it's unlikely we can get datalog production ready</p>
</blockquote>
<p>But this comment makes it feel like that's maybe not the case?</p>



<a name="221161488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221161488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221161488">(Dec 29 2020 at 19:50)</a>:</h4>
<p>that's my own feeling, I'm not sure it's shared by others</p>



<a name="221161514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221161514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221161514">(Dec 29 2020 at 19:50)</a>:</h4>
<p>it's not going away that's for sure, whether it'll be the only way to do the analyses is another idea</p>



<a name="221161579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221161579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221161579">(Dec 29 2020 at 19:51)</a>:</h4>
<p>like, if we need to run the rules on crater, and some of the huge functions out there, all this would still be worthwhile</p>



<a name="221161721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221161721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221161721">(Dec 29 2020 at 19:53)</a>:</h4>
<p>whether it'd be improving polonius itself, or the rules, or datafrog</p>



<a name="221161849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221161849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221161849">(Dec 29 2020 at 19:55)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116113">lqd</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/Optimization.20PRs/near/221161488">said</a>:</p>
<blockquote>
<p>that's my own feeling, I'm not sure it's shared by others</p>
</blockquote>
<p>Is the problem with datafrog the frontend? You want something that accepts actual datalog rules so you can iterate faster?</p>



<a name="221161855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221161855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221161855">(Dec 29 2020 at 19:55)</a>:</h4>
<p>it's also true that reviews of datafrog would probably be tougher</p>



<a name="221161981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221161981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221161981">(Dec 29 2020 at 19:56)</a>:</h4>
<p>not especially to iterate faster, I have a datafrog generator to help with that <a href="https://github.com/lqd/datapond/">https://github.com/lqd/datapond/</a>, and Vytautas has revamped it completely for "rustql" (I forgot the new name of the project) with a proc-macro and everything</p>



<a name="221162061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221162061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221162061">(Dec 29 2020 at 19:57)</a>:</h4>
<p>Is it architectural (i.e. you want something that uses a different strategy or defaults to <code>BTree</code>s or works out-of-memory)? Or just general code quality?</p>



<a name="221162066"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221162066" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221162066">(Dec 29 2020 at 19:57)</a>:</h4>
<p>just to be more efficient than allocations in a hot loop, for the cases when it can be avoided; say reachability queries, or TC over dynamic graphs</p>



<a name="221162246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221162246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221162246">(Dec 29 2020 at 19:59)</a>:</h4>
<p>a different strategy could be interesting to avoid some of the problems of bottom-up evaluation, but I've been trying for a while to transform the rules to demand data like a top-down evaluation would</p>



<a name="221162356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221162356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221162356">(Dec 29 2020 at 20:00)</a>:</h4>
<p>I know the literature always mention scalability to huge codebases, but I don't remember off hand what the actual numbers are, it seems like they're comparing "queries that resolve overnight" to "a few seconds"</p>



<a name="221162373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221162373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221162373">(Dec 29 2020 at 20:00)</a>:</h4>
<p>a few seconds is orders of magnitude too slow</p>



<a name="221162427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221162427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221162427">(Dec 29 2020 at 20:01)</a>:</h4>
<p>I'm not sure what is attainable :)</p>



<a name="221162516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221162516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221162516">(Dec 29 2020 at 20:02)</a>:</h4>
<p>but it's likely that a kind of "graded borrow-checking" would be required, that is, there'd need to be a strong focus on the lowest grades, like the location-insensitive pass</p>



<a name="221162521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221162521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221162521">(Dec 29 2020 at 20:02)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116113">lqd</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/Optimization.20PRs/near/221162246">said</a>:</p>
<blockquote>
<p>a different strategy could be interesting to avoid some of the problems of bottom-up evaluation, but I've been trying for a while to transform the rules to demand data like a top-down evaluation would</p>
</blockquote>
<p>I'm <em>way</em> outside my area of expertise here, but bottom-up seemed like the correct paradigm to me since we want to find <em>all</em> errors in the function. It seemed like top-down (and optimizations like magic-set) are more for queries with one or more constants in the head.</p>



<a name="221162675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221162675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221162675">(Dec 29 2020 at 20:04)</a>:</h4>
<p>both should find the same errors I feel, but you could also say that we're checking specific loans and origins</p>



<a name="221162702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221162702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221162702">(Dec 29 2020 at 20:04)</a>:</h4>
<p>that is only the loans which are invalidated, and the origins through which they flow need tracking</p>



<a name="221162726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221162726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221162726">(Dec 29 2020 at 20:05)</a>:</h4>
<p>My long-term ideas were more in line with your first comment, using specialized strategies for TC and different storage for dense relations.</p>



<a name="221162770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221162770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221162770">(Dec 29 2020 at 20:05)</a>:</h4>
<p>location-insensitivity seems super important to me, and my prototypes on this analysis, without datafrog, were promising</p>



<a name="221162784"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221162784" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221162784">(Dec 29 2020 at 20:05)</a>:</h4>
<p>right</p>



<a name="221162862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221162862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221162862">(Dec 29 2020 at 20:06)</a>:</h4>
<p>I haven't read the location-insensitive or optimized rules at all, just the naive ones.</p>



<a name="221162883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221162883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221162883">(Dec 29 2020 at 20:06)</a>:</h4>
<p>the location-insensitive ones are super simple thankfully</p>



<a name="221162897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221162897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221162897">(Dec 29 2020 at 20:07)</a>:</h4>
<p>but it's ultimately simple reachability queries</p>



<a name="221162913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221162913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221162913">(Dec 29 2020 at 20:07)</a>:</h4>
<p>which to me doesn't map nicely to datalog for efficiency ^^</p>



<a name="221162927"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221162927" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221162927">(Dec 29 2020 at 20:07)</a>:</h4>
<p>but it does work :)</p>



<a name="221163007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221163007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221163007">(Dec 29 2020 at 20:08)</a>:</h4>
<p>I don't know if I was really helpful answering your questions, but gotta go eat dinner</p>



<a name="221163018"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221163018" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221163018">(Dec 29 2020 at 20:08)</a>:</h4>
<p>Yeah, the "ideological purity" of Horn clauses isn't as appealing when you need to implement a custom solver for each one</p>



<a name="221163116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221163116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221163116">(Dec 29 2020 at 20:10)</a>:</h4>
<p>No worries, thanks for chatting</p>



<a name="221163119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221163119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221163119">(Dec 29 2020 at 20:10)</a>:</h4>
<p>specialized relations would be interesting for sure, as well as cleverness in the rules, or fact generation</p>



<a name="221163151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221163151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221163151">(Dec 29 2020 at 20:10)</a>:</h4>
<p>e.g IIRC we duplicate MIR locations into 2 polonius points, I think, to easily order effects</p>



<a name="221163208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221163208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221163208">(Dec 29 2020 at 20:11)</a>:</h4>
<p>I have a few more datafrog micro-optimizations that I'll post tonight since they're so easy and have pretty big wins, then  I'll spend some time trying to grok the other rulesets. Seems like <span class="user-mention silent" data-user-id="116155">Jake Goulding</span> might be able to do a preliminary review.</p>



<a name="221163213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221163213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221163213">(Dec 29 2020 at 20:11)</a>:</h4>
<p>it's possible that with more clever rules, that wouldn't be needed at all, and severely limit the size of the cfg which is would be helpful on the whole computation</p>



<a name="221163272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221163272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221163272">(Dec 29 2020 at 20:12)</a>:</h4>
<p>I have elsewhere prototypes about CFG compression and the likes</p>



<a name="221163295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221163295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221163295">(Dec 29 2020 at 20:12)</a>:</h4>
<p>I forgot to say one thing: we were more focused on completeness and correctness at first (and still are ofc)</p>



<a name="221163345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221163345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221163345">(Dec 29 2020 at 20:13)</a>:</h4>
<p>to be sure that the final rules would be good and bug-free (and that they aren't, say, too lenient in what code they accept) before focusing on efficiency</p>



<a name="221163420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221163420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221163420">(Dec 29 2020 at 20:14)</a>:</h4>
<p>that ties into what you were saying about whether the rules would change before optimizing</p>



<a name="221163467"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221163467" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221163467">(Dec 29 2020 at 20:15)</a>:</h4>
<p>we're not there yet, in some sense we're not far, but there definitely are unknown unknowns :)</p>



<a name="221163724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221163724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221163724">(Dec 29 2020 at 20:18)</a>:</h4>
<p>Well lemme know if you think of any good discrete tasks. Otherwise I have some ideas I want to explore. And go eat XD.</p>



<a name="221163765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221163765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221163765">(Dec 29 2020 at 20:19)</a>:</h4>
<p>it's also very likely that Niko would have ideas on what cool things you could do :)</p>



<a name="221163818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221163818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221163818">(Dec 29 2020 at 20:20)</a>:</h4>
<p>alright, cheers, bbl</p>



<a name="221163848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221163848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221163848">(Dec 29 2020 at 20:20)</a>:</h4>
<p>(also: thanks so much)</p>



<a name="221166923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221166923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221166923">(Dec 29 2020 at 21:04)</a>:</h4>
<p>so yeah, datalog is not going away, and work on datafrog could be more stable than the rules per se (although both will be ultimately needed)</p>



<a name="221169007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221169007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221169007">(Dec 29 2020 at 21:30)</a>:</h4>
<p>(also: many thanks to <span class="user-mention silent" data-user-id="116155">Jake Goulding</span>  for the early reviews on that PR :)</p>



<a name="221194902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221194902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221194902">(Dec 30 2020 at 07:12)</a>:</h4>
<p><span class="user-mention" data-user-id="118594">@ecstatic-morse</span> Thank you for working on this. I'm excited to see more activity on polonius.</p>



<a name="221194920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221194920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221194920">(Dec 30 2020 at 07:12)</a>:</h4>
<p>Including performance.</p>



<a name="221194957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221194957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221194957">(Dec 30 2020 at 07:13)</a>:</h4>
<p>I've used it on nightly a few times, and I'm always impressed by what it can handle and how comfortable it feels.</p>



<a name="221198739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221198739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221198739">(Dec 30 2020 at 08:45)</a>:</h4>
<p>hopefully it wasn't one of those cases where the parts that are not done yet missed actual errors <span aria-label="sweat" class="emoji emoji-1f613" role="img" title="sweat">:sweat:</span> (we really should add the "this is an unfinished feature" warning like const generics had)</p>



<a name="221291429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221291429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vytautas Astrauskas [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221291429">(Dec 31 2020 at 13:54)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116113">lqd</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/Optimization.20PRs/near/221161981">said</a>:</p>
<blockquote>
<p>not especially to iterate faster, I have a datafrog generator to help with that <a href="https://github.com/lqd/datapond/">https://github.com/lqd/datapond/</a>, and Vytautas has revamped it completely for "rustql" (I forgot the new name of the project) with a proc-macro and everything</p>
</blockquote>
<p>It was reborn as <a href="https://github.com/rust-corpus/qrates/">Qrates</a>. Let me know if you have any questions about what is implemented.</p>



<a name="221366800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221366800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221366800">(Jan 01 2021 at 20:12)</a>:</h4>
<p>I wrote up some of my thoughts across a few thread, but I'm worried that I've been focused on the wrong problem. There's no point in optimizing things if we can't express these rules in datalog, and <a href="https://smallcultfollowing.com/babysteps/blog/2019/01/21/hereditary-harrop-region-constraints/">https://smallcultfollowing.com/babysteps/blog/2019/01/21/hereditary-harrop-region-constraints/</a> makes it seem like that question might not be settled. Has there been any progress on that front in the intervening years?</p>



<a name="221373953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221373953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221373953">(Jan 01 2021 at 23:16)</a>:</h4>
<p>there has been some</p>



<a name="221373975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221373975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221373975">(Jan 01 2021 at 23:17)</a>:</h4>
<p>the tentative plan (which is mostly inside niko's head, and possibly parts of matthew's) is to have chalk and polonius cooperate on that problem</p>



<a name="221374024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221374024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221374024">(Jan 01 2021 at 23:18)</a>:</h4>
<p>&lt;handwave&gt;like chalk would see the higher-order constraints and spit out first-order constraints for polonius as-is to solve&lt;/handwave&gt;</p>



<a name="221374107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221374107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221374107">(Jan 01 2021 at 23:20)</a>:</h4>
<p>there has been some related work in chalk, I recall seeing branches from niko on that subject, but that's about all I remember</p>



<a name="221374267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221374267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221374267">(Jan 01 2021 at 23:25)</a>:</h4>
<p>that being said, chalk is more active and with more contributors, and has had very little perf work done, that may be a better use of your time and skills</p>



<a name="221374331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221374331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221374331">(Jan 01 2021 at 23:26)</a>:</h4>
<p>it would not be wasted at all</p>



<a name="221374712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Optimization%20PRs/near/221374712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Optimization.20PRs.html#221374712">(Jan 01 2021 at 23:37)</a>:</h4>
<p>Understood. I'm still drawn to polonius. I guess because it seems a bit narrower in scope than chalk. I'll keep trying to gain some intuition for the borrow checking rules. Maybe I'll be useful during the next sprint.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>